CREATE PROCEDURE dbo.sp_InsertaArea

@Area int ,
@Nombre varchar(50) ,
@Cedula_Usuario int , 
@Return int OUTPUT

AS

DECLARE
@Error int

SET XACT_ABORT ON
BEGIN TRANSACTION

INSERT Area VALUES( @Area , @Nombre , @Cedula_Usuario ) 

SET @Error = @@error
IF @Error = 0
	BEGIN
	COMMIT TRANSACTION
	SET @Return = 0
	END
ELSE
	BEGIN
	ROLLBACK TRANSACTION
	SET @Return = -1
	END

SET XACT_ABORT OFF

SELECT @Return 
RETURN 
